Component({
    properties: {
        sid: {
            type: String,
            value: "",
            observer: function(t) {
                this.setData({
                    sid: t
                });
            }
        },
        mode: {
            type: String,
            value: "view",
            observer: function(t) {
                this.setData({
                    mode: t
                });
            }
        },
        app: {
            type: String,
            value: "site",
            observer: function(t) {
                this.setData({
                    app: t
                });
            }
        },
        expiretime: {
            type: String,
            observer: "checkExpiration"
        },
        isFromList: {
            type: Boolean,
            value: !1,
            observer: function(t) {
                this.setData({
                    isFromList: t
                });
            }
        },
        isEditable: {
            type: Boolean,
            value: !1,
            observer: function(t) {
                this.setData({
                    isEditable: t
                });
            }
        },
        isTabInit: {
            type: Boolean,
            value: !1,
            observer: function(t) {
                this.setData({
                    isTabInit: t
                });
            }
        }
    },
    ready: function() {
        var t = getCurrentPages();
        this.currPage = t[t.length - 1];
    },
    data: {
        sid: "",
        app: "site",
        mode: "view",
        isexpire: !1,
        isFromList: !1,
        isEditable: !1,
        isTabInit: !1
    },
    methods: {
        checkExpiration: function(t) {
            var e = Date.now() > Date.parse(t.split(" ")[0]);
            this.setData({
                isexpire: e
            });
        },
        redirectToMembers: function() {
            var t = this.data.sid;
            wx.navigateTo({
                url: "/pages/profile-entry/members/members?sid=" + t
            });
        },
        updateEditStatus: function() {
            if (this.data.isexpire) this.currPage.setData({
                isExpireModalShown: !0
            }); else {
                this.triggerEvent("updatestatus", {});
                var t = (this.currPage.data.site || this.currPage.data.siteData).content, e = void 0 === t ? [] : t, i = this.currPage.data.$$editor.sections;
                e.length || i.length || this.currPage.$$editorAddSection({
                    type: "text",
                    data: {
                        content: ""
                    }
                }, 0);
            }
        },
        toggleListSettingStatus: function() {
            var t = this.currPage.data.isListSetting;
            this.data.isexpire ? this.currPage.setData({
                isExpireModalShown: !0
            }) : this.currPage.setData({
                isListSetting: !t
            });
        }
    }
});